<template>
  <div class="detail-panel">
    <div class="panel-header">
      <span class="back-text" @click="closeDetail">返回</span>
      <div class="title-wrapper">
        <span class="line"></span>
        <h2 class="panel-title">详情</h2>
        <span class="line"></span>
      </div>
    </div>
    <div class="panel-content">
      <p class="total-count">总标注人数：{{ count }}人</p>
      <p class="label-student">标注学生：</p>
      <div class="student-numbers">
        <span
            class="student-number"
            v-for="(num, index) in numbers"
            :key="index"
        >{{ num }}</span>
      </div>
    </div>
  </div>
</template>

<script setup>
import { defineProps, defineEmits } from "vue";

const props = defineProps({
  count: {
    type: Number,
    required: true,
  },
  numbers: {
    type: Array,
    required: true,
  },
});

const emit = defineEmits(["close"]);

const closeDetail = () => {
  emit("close");
};
</script>

<style scoped>
.detail-panel {
  width: 100%;
  height: 100%;
  padding: 20px;
  box-sizing: border-box;
}

.panel-header {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.back-text {
  font-size: 20px;
  color: #e95294;
  cursor: pointer;
  margin-right: 20px;
}

.title-wrapper {
  display: flex;
  align-items: center;
  flex: 1;
  justify-content: center;
}

.line {
  flex: 1;
  height: 1px;
  background-color: #ddd;
  margin: 0 10px;
}

.panel-title {
  font-size: 20px;
  color: #e95294;
  margin: 0;
}

.panel-content {
  height: 90%;
  background-color: #eee;
  padding: 20px;
  border-radius: 4px;
}

.total-count,
.label-student {
  font-size: 20px;
  margin-bottom: 10px;
}

.student-numbers {
  display: flex;
  flex-wrap: wrap;
}

.student-number {
  font-size: 16px;
  display: inline-block;
  margin-left: 15px;
  width: 40px; /* 每排五个，占20%宽度 */
  box-sizing: border-box;
  height: 35px;
  line-height: 32px;
  text-align: center;
  background-color: #ffffff;
  border-radius: 50%;
  margin-bottom: 10px;
}
</style>
